

<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <ul class="sidebar-menu">
            <li class="header">Main</li>
            <li class="treeview">
                <a href="#">
                    <i class="fa fa-dashboard"></i> <span>面板</span> <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    <li><a href="index.php?p=dashboard"><i class="fa fa-circle-o"></i>查看</a></li>
                </ul>
            </li>

            <li class="treeview">
                <a href="#">
                    <i class="fa fa-video-camera"></i> <span>视频</span> <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    <li  class="active"><a href="index.php?p=video_list"><i class="fa fa-circle-o"></i>查看</a></li>
                    <li ><a href="index.php?p=video_add"><i class="fa fa-circle-o"></i>添加</a></li>
                </ul>
            </li>
            <li class="treeview">
                <a href="#">
                    <i class="fa fa-gears"></i> <span>类型</span> <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    <li class="active"><a href="index.php?p=category_list"><i class="fa fa-circle-o"></i>查看</a></li>
                    <li><a href="index.php?p=category_add"><i class="fa fa-circle-o"></i>添加</a></li>
                </ul>
            </li>
            <li class="active treeview">
                <a href="#">
                    <i class="fa fa-adn"></i> <span>广告</span> <i class="fa fa-angle-left pull-right"></i>
                </a>
                <ul class="treeview-menu">
                    <li ><a href="index.php?p=ad_list"><i class="fa fa-circle-o"></i>查看</a></li>
                    <li class="active"><a href="index.php?p=ad_add"><i class="fa fa-circle-o"></i>添加</a></li>
                </ul>
            </li>
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            广告
            <small>添加</small>
        </h1>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="panel panel-default">
        <div class="panel-heading">
            <h4>新广告</h4>
        </div>
        <div class="panel-body">
            <div class="row">
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="ad_type" class="col-sm-2 control-label">广告类别</label>
                        <div class="col-sm-10">
                            <select name="" id="ad_type">
                                <?php
                                             $rows=$mysql->query("select * from `ad_type`");
                                foreach($rows as $row){
                                echo "<option value='".$row['id']."'>".$row['name']."</option>";
                                }

                                ?>
                            </select>
                            <a class="btn ad-type-door">添加</a>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="ad_title" class="col-sm-2 control-label">广告标题</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="ad_title"
                                   placeholder="不超过15字">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="ad_detail" class="col-sm-2 control-label">广告详情</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="ad_detail"
                                   placeholder="不超过30字">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="ad_url" class="col-sm-2 control-label">广告url</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="ad_url"
                                   placeholder="请输入网址以http://或者https://开头">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="ad_img_outer_url" class="col-sm-2 control-label">图片外链</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="ad_img_outer_url" placeholder="只能与图片上传二选一">
                        </div>
                    </div>
                </form>





                <form class="form-horizontal" role="form" action="http://wx.miuiad.com/PhalApi/Public/xxkpcms/?service=Admin.UploadImg" id="imageUploadForm" enctype="multipart/form-data">
                    <label for="ImageBrowse" class="col-sm-2 control-label">图片上传</label>
                    <div class="col-sm-8">
                        <input type="file" id="ImageBrowse" name="img" />
                        <input type="submit" hidden="hidden" name="upload" value="Upload" />
                    </div>
                    <div class="col-sm-8">

                        <img class="videoImg" src="" alt="">
                    </div>
                </form>

                <div class="form-group col-sm-10">

                    <div class="col-sm-offset-2 col-sm-3">
                        <button type="button" id="resetAd" class="btn btn-default">重置</button>
                    </div>
                    <div class=" col-sm-3">
                        <button type="submit" id="addAd" class="btn btn-primary">添加</button>
                    </div>
                </div>
            </div>
        </div>
</div>

    </section><!-- /.Left col -->
</div><!-- /.row (main row) -->

<div class="modal ad-type-model">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close ad-type-model-close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 class="modal-title">类别列表</h4>
                <hr>
                <table id="adType-table" class="table table-bordered table-hover table-condensed">
                    <thead>
                    <tr>
                        <th>类别id</th>
                        <th>类别名称</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="adTypeTable">
                    <?php
                                                 $rows=$mysql->query("select * from `ad_type`");
                    foreach($rows as $row){
                    echo "<tr><td>".$row['id']."</td><td>".$row['name']."</td><td><a><i class='fa fa-times ad-type-del' title=".$row['id']."></i></a></td></tr>";
                    }

                    ?>
                    </tbody>
                </table>
            </div>
            <div class="modal-body">
                <h4 class="modal-title">类别添加</h4>
                <hr>
                <form class="form-horizontal" role="form">

                    <div class="form-group">
                        <label for="ad-type-name" class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" id="ad-type-name"
                                   placeholder="请输入广告类别名称">
                        </div>
                    </div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left ad-type-model-close" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary addAdType">添加类别</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

